<template>
    <a-table :dataSource="dataList" :loading="tableLoading" :pagination="false" bordered >
        <a-table-column title="姓名">
            <template slot-scope="t,r,i" >
                <span> {{r.name}} </span>
            </template>
        </a-table-column>
        <a-table-column title="性别">
            <template slot-scope="t,r,i" >
                <span> {{r.sex}} </span>
            </template>
        </a-table-column>
        <a-table-column title="身份证">
            <template slot-scope="t,r,i" >
                <span> {{r.sfzh}} </span>
            </template>
        </a-table-column>
        <a-table-column title="操作">
            <template slot-scope="t,r,i" >
                <a @click="showFile(r,0)">生成文档</a>
                <a-divider type="vertical" />
                <a @click="showFile(r,1)">附件</a>
                <a-modal :visible="ckxqVisible" title="详情" width="60%" @cancel="ckxqVisible = false">
                    <showInfoForm ref="showInfoRef" :procInstId="procInstId" :peopleId="peopleId"></showInfoForm>
                    <template #footer>
                        <a-button key="back" @click="ckxqVisible = false">关闭</a-button>
                    </template>
                </a-modal>
            </template>
        </a-table-column>
    </a-table>
</template>
<script>
    import { postFormAction } from '@/api/manage'
    import showInfoForm from './applyShowInfo'

    export default {
        name: "applyPeople",
        components: {
            showInfoForm
        },
        props:{
            procInstId: String
        },
        created(){
        },
        data () {
            return {
                peopleId: '',
                ckxqVisible: false,
                tableLoading: false,
                dataList: [],
            }
        },
        computed:{
        },
        methods: {
            getDataList(){
                this.tableLoading = true
                postFormAction('/bj/bjIdcardfk/getLizhiPersonList', {"procInstId": this.procInstId} ).then((res) => {
                    this.dataList = res.result
                    this.tableLoading = false
                })
            },
            showFile(r,num){
                this.ckxqVisible = true
                this.peopleId = r.id
                this.$nextTick(() => {
                    this.$refs.showInfoRef.getDataList(num)
                })
            }
        }
    }
</script>
